/*
 * mainwindow.h - Main window GUI
 *
 * Copyright (C) 2010-2011 Serge Begger
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSettings>
#include "player/player.h"
#include "radio/radio.h"
#include "analogtv/analogtv.h"
#include "configure/configure.h"
#include "handsfree/handsfree.h"
#include "freessm/src/FreeSSM.h"
#include "dvbt/dvbt.h"
#include "navi.h"
#include "mixer/mixer.h"
#include "screensaverdeactivator.h"
#include "poweroff.h"
#include "gpsinterface.h"
#include "speechengine.h"
#include "udiskinterface.h"
#include "poweroffnotifer.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    int currVolume, prewWidgetIndex, prewEQWidgetIndex, prewMMWidgetIndex;
    QSettings *settings;
    player *mmplayer;
    Radio *radiofm;
    analogtv *analogTV;
    dvbt *dvbtWidget;
    navi *naviWidget;
    configure *configWidget;
    handsfree *phoneWidget;
    FreeSSM *freessmWidget;
    mixer *Mixer;
    poweroff *powerDlg;
    poweroffnotifer *pw_off_notif;
    gpsinterface *gps;
    QString typeStyleShhet;
    void muteSound(bool);
    void updateVolSlider();
    speechengine *spengine;
    festivalStarter *fserver;
    ScreenSaverDeactivator *ssdeact;
    QHash<QString, bool> ssavers;
    gslider *volSlider;
    udiskInterface *uDiface;

private slots:
    void on_muteButton_toggled(bool);
    void on_soundSetButton_pressed();
    void hideEqWidget();
    void phoneCall(bool);
    void on_actWidgButton_pressed();
    void on_playerButton_pressed();
    void on_radioButton_pressed();
    void on_tvButton_pressed();
    void on_dvbtButton_pressed();
    void on_naviButton_pressed();
    void on_handsFreeButton_pressed();
    void on_configButton_pressed();
    void on_diagButton_pressed();
    void on_powerButton_pressed();
    void on_volUpButton_pressed();
    void on_volDwButton_pressed();
    void setMmVolume();
    void closeMmWidget();
    void destroyCfgWidget();
    void destroyMmWidget();
    void destroyAllWidget();
    void hideMmWidget();
    void destroyNaviWidget();
    void destroyFreeSSMWidget();
    void connectHFSDevice();
    void disconnectHFSDevice();
    void changeEQ(double*);
    void setEQValue();
    void changeStyleSheet();
    void speechText(QByteArray);
    void volumeAdded(QString);
    void powerOff();
};

#endif // MAINWINDOW_H
